import sympy
import math

x = sympy.Symbol('x')
a = 0
b = math.pi / 2
f = sympy.exp(-sympy.sin(x))

M = f.subs(x, 0)
m = f.subs(x, math.pi / 2)
interval_length = b - a

lower_bound = m * interval_length
upper_bound = M * interval_length
integral_result = sympy.integrate(f, (x, a, b))

print(f"m = {m:.4f}, M = {M:.4f}, b-a = {interval_length:.4f}")
print(f"下界: {lower_bound:.4f}, 上界: {upper_bound:.4f}")
print(f"积分值: {integral_result:.4f}")
print(f"验证: {lower_bound:.4f} ≤ {integral_result:.4f} ≤ {upper_bound:.4f}")